package com.client.service.impl;

import com.client.pojo.Comments;
import com.client.dao.CommentsDao;
import com.client.service.CommentsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * <p>
 * 评论系统表 服务实现类
 * </p>
 *
 * @author ckick
 * @since 2025-09-20 08:28:54
 */
@Service
public class CommentsServiceImpl extends ServiceImpl<CommentsDao, Comments> implements CommentsService {

    @Autowired
    private CommentsDao commentsDao;

    //根据词条id获取父级评论和对应的用户信息,同时实现分页
    @Override
    public List<Comments> getCommentsByEntryId(Integer entryId, Integer offset, Integer limit) {

        List<Comments> result = commentsDao.getCommentsByEntryId(entryId, offset, limit);
        return result;
    }
    
    //根据评论id获取子评论列表
    @Override
    public List<Comments> getChildrenByCommentId(Integer commentId, Integer offset, Integer limit) {
        List<Comments> result = commentsDao.getChildrenByCommentId(commentId, offset, limit);
        return result;
    }
}
